Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix(dependencies/chip): latest input dependencies and new styling for the chip tested #151

Closed
wants to merge 3 commits into from

Conversation

CarloBar1
Copy link
Contributor

@CarloBar1 CarloBar1 commented Mar 4, 2024

About feature AB#11519 - part of the inputs restyling. Dependencies update and testing of a more squared chip for the new input design.
image

@CarloBar1 CarloBar1 changed the title Fix/update input deps Fix(dependencies/chip): latest input dependencies and new styling for the chip tested Mar 4, 2024
Copy link
Contributor

@cristinecula cristinecula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The margins around the chip are not equal. If you force the input to be narrower, it is more apparent:
Screenshot_2024-03-04_16-16-29

You should also make sure that an input with multiple chips selected looks good.

@CarloBar1
Copy link
Contributor Author

CarloBar1 commented Mar 5, 2024

The margins around the chip are not equal. If you force the input to be narrower, it is more apparent: Screenshot_2024-03-04_16-16-29

You should also make sure that an input with multiple chips selected looks good.

@cristinecula addressed this in my latest commit. The chip had an odd styling, but I added an exported part for it. The uncentering was due to an uneven padding, but I fixed that adding an extra margin to compensate it.

Also, the odd spacing was due to a mistake - I set "CHoose color" as placeholder and not as label - fixed.
And when more than one chip is present this is the look:
image

@CarloBar1 CarloBar1 requested a review from cristinecula March 11, 2024 08:25
@@ -31,7 +31,7 @@ type AProps<I> = Omit<Props<I>, keyof RProps<I>> &

const blank = () => nothing;

const inputParts = ['input', 'control', 'label', 'line', 'error']
const inputParts = ['input', 'control', 'label', 'line', 'error', 'chip', 'chip-text', 'chip-clear']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputParts gets set on <cosmoz-input [..] exportparts=${inputParts}, but the parts you have added to the list are not part of cosmoz-input. This change has no effect.

.limit=${5}
.textProperty=${'text'}
.value=${colors[0]}
contour
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is up with this contour attribute?

Comment on lines +98 to +103
cosmoz-autocomplete::part(input-control) {
margin: 0 8px;
}
cosmoz-autocomplete::part(chip-clear) {
margin-left: 4px;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should expose these as css variables: --cosmoz-autocomplete-input-control-margin and --cosmoz-autocomplete-chip-clear-margin, instead of relying on parts. Parts are good, but css variables are better, because they cascade.

@CarloBar1 CarloBar1 closed this Mar 22, 2024
@cristinecula cristinecula deleted the fix/update-input-deps branch March 22, 2024 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants